package basic7;

public class J13_Q77_books_OOP {

	public static void main(String[] args) {

		J13_Book book;

		book = new J13_Book(12345, "누구나 알기 쉬운", "혜지원", "다케시", "스릴러", "22500",
				false, "2014-06-10");

		J13_Book[] books = new J13_Book[5];
		// 대여한 책을 저장하기 위해 배열 선언
		books[0] = book; // 대여한 책을 배열에 저장

		J13_Member member = new J13_Member(98765, "수지", "123-456-789",
				new J13_Book[] { book }, 12345);
	}// 메인

}// 클래스

class J13_Book {

	private int bookno;
	private String bookName;
	private String publisher;
	private String author;
	private String genre;
	private String price;
	private boolean isRent;
	private String regdate;

	public J13_Book() {
	}

	public J13_Book(int bookno, String bookName, String publisher,
			String author, String genre, String price, boolean isRent,
			String regdate) {
		this.bookno = bookno;
		this.bookName = bookName;
		this.publisher = publisher;
		this.author = author;
		this.genre = genre;
		this.price = price;
		this.isRent = isRent;
		this.regdate = regdate;
	}

	public String toString() {
		String bookInfo = "도서명 :" + bookName;
		bookInfo += "출판사 : " + publisher;
		return bookInfo;
	}
}// class

class J13_Member {

	// 회원관련
	private int memberNo;
	private String name;
	private String telno;
	/*
	 * private int rbookno1; //대여중인 책 private int rbookno2; //대여중인 책 private int
	 * rbookno3; //대여중인 책 private int rbookno4; //대여중인 책 private int rbookno5;
	 * //대여중인 책
	 */
	private J13_Book[] rBookNos;
	private int mileage;

	public J13_Member() {
	}

	public J13_Member(int memberNo, String name, String telno,
			J13_Book[] rBooks, int mileage) {
		this.memberNo = memberNo;
		this.name = name;
		this.telno = telno;
		this.rBookNos = rBookNos;
		this.mileage = mileage;

	}
}
